import Mock from 'mockjs';

export default {
  // 角色列表
  'GET /api/admin/role/list': Mock.mock({
    success: 1,
    message: '@paragraph',
    data: {
      'items|10': [
        {
          'id|+1': 1,
          name: '@cword(2, 6)',
          remark: '@cword(32)',
          created_at: '@datetime',
        },
      ],
    },
  }),
  // 角色信息
  'GET /api/admin/role/:id': Mock.mock({
    success: 1,
    message: '@paragraph',
    data: {
      'id|+1': 1,
      name: '@word(10)',
      remark: '@cword(32)',
      created_at: '@datetime',
    },
  }),
  // 获取角色的用户
  'GET /api/admin/role/:id/users': Mock.mock({
    success: 1,
    message: '@paragraph',
    data: {
      'items|10': [
        {
          'id|+1': 1,
          username: '@word(10)',
          nickname: '@cword(5)',
          remark: '@cword(32)',
          created_at: '@datetime',
        },
      ],
    },
  }),
  // 将用户移出角色
  'DELETE /api/admin/role/:id/users': Mock.mock({
    success: 1,
    message: '@paragraph',
  }),
  // 删除角色
  'DELETE /api/admin/role/:id': Mock.mock({
    success: true,
    message: '@paragraph',
  }),
  // 获取权限列表
  'GET /api/admin/role/:id/permissions': Mock.mock({
    success: true,
    message: '@paragraph',
    data: {
      'items|10': [
        {
          'id|+1': 1,
          name: '@word(10)',
          title: '@cword(5)',
          created_at: '@datetime',
        },
      ],
    },
  }),
  // 添加权限
  'POST /api/admin/role/:id/permissions': Mock.mock({
    success: true,
    message: '@paragraph',
  }),
  // 删除权限
  'DELETE /api/admin/role/:id/permissions': Mock.mock({
    success: true,
    message: '@paragraph',
  }),
};
